const Newsinfo = require("../../db").Newsinfo

module.exports = {
    async find(ctx, next) {
        let id = ctx.params.id
        try {
            let news = await Newsinfo.find({ "id":id },(err,doc)=>{
                if(!err){
                    console.log(doc)
                }
            })
            ctx.body = {
                code: 200,
                msg: "获取信息成功",
                list: news
            }
        } catch(e){
            console.log(e)
            ctx.body = {
                code: 500,
                msg: "获取信息失败，服务器异常，请稍后再试",
                getErr: e
            }
        }
    }
}